Skip to content

Add capability to raise JwtBearer events#86

Merged
Shane32 merged 8 commits into
masterfrom
add_events
May 7, 2025
Merged

Add capability to raise JwtBearer events#86
Shane32 merged 8 commits into
masterfrom
add_events

Conversation

@Shane32

@Shane32 Shane32 commented May 7, 2025

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added support for JWT Bearer authentication in GraphQL, including WebSocket authentication and flexible configuration options.
    • Introduced options to enable or customize JWT authentication event handling for advanced scenarios.
  • Bug Fixes

    • Improved authentication flow to allow event-driven customization during JWT authentication over WebSockets.
  • Tests

    • Enhanced and extended test coverage for new authentication features and configuration options.

@Shane32 Shane32 self-assigned this May 7, 2025
@coderabbitai

coderabbitai Bot commented May 7, 2025

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@Shane32 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 033f8df and 92a6486.

📒 Files selected for processing (1)
  • src/Tests/Tests.csproj (1 hunks)
📝 Walkthrough

Walkthrough

The changes introduce configurable JWT Bearer authentication support for GraphQL WebSocket connections. A new options class and extension methods allow enabling or customizing JWT event handling. The WebSocket authentication service is updated to trigger JWT authentication events based on configuration. Associated tests and API approval files are updated to reflect the new features and public API surface.

Changes

File(s) Change Summary
src/GraphQL.AspNetCore3.JwtBearer/AspNetCore3JwtBearerExtensions.cs Added two overloads to AddJwtBearerAuthentication extension method: one with a bool enableJwtEvents parameter and another with an Action<JwtBearerAuthenticationOptions> for custom configuration. The parameterless version now delegates to the configuration overload. The configuration action is applied to services before adding WebSocket authentication.
src/GraphQL.AspNetCore3.JwtBearer/JwtBearerAuthenticationOptions.cs Introduced the JwtBearerAuthenticationOptions class with a boolean property EnableJwtEvents to control JWT event handling.
src/GraphQL.AspNetCore3.JwtBearer/JwtWebSocketAuthenticationService.cs Enhanced to support JWT authentication event handling (MessageReceived, TokenValidated, AuthenticationFailed) when enabled via options. Updated constructor to accept new options and scheme provider dependencies. Added private async methods to trigger events and a private EventResult class to encapsulate event outcomes.
src/Tests.ApiApprovals/ApiApprovalTests.cs Added JwtWebSocketAuthenticationService to the list of types checked in the public API approval tests. Updated using directives accordingly.
src/Tests.ApiApprovals/GraphQL.AspNetCore3.JwtBearer.approved.txt Updated/added approved public API surface to reflect new classes, methods, and properties for JWT Bearer authentication support.
src/Tests.ApiApprovals/Tests.ApiTests.csproj Added project reference to GraphQL.AspNetCore3.JwtBearer.csproj to include new JWT Bearer authentication features in tests.
src/Tests/JwtBearer/AspNetCore3JwtBearerExtensionsTests.cs Updated test setup to mock the Configure method for JwtBearerAuthenticationOptions in extension method tests.
src/Tests/JwtBearer/JwtWebSocketAuthenticationServiceTests.cs Modified test server setup to call AddJwtBearerAuthentication(true) enabling JWT events during tests.
.github/workflows/test.yml Removed .NET Core SDK 3.1.x and 5.0.x versions from the test matrix in GitHub Actions workflow.
src/Tests/Tests.csproj Removed target frameworks netcoreapp3.1 and net5.0 from test project and deleted related package references.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant GraphQLServer
    participant JwtWebSocketAuthenticationService
    participant JwtBearerEvents

    Client->>GraphQLServer: Initiate WebSocket connection with JWT
    GraphQLServer->>JwtWebSocketAuthenticationService: AuthenticateAsync(request)
    alt EnableJwtEvents = true
        JwtWebSocketAuthenticationService->>JwtBearerEvents: Trigger MessageReceived
        alt MessageReceived handled
            JwtWebSocketAuthenticationService-->>GraphQLServer: Return principal (early exit)
        else
            JwtWebSocketAuthenticationService->>JwtBearerEvents: Trigger TokenValidated
            alt TokenValidated failed
                JwtWebSocketAuthenticationService-->>GraphQLServer: Continue to next scheme
            else
                JwtWebSocketAuthenticationService-->>GraphQLServer: Return principal
            end
        end
        alt Token validation exception
            JwtWebSocketAuthenticationService->>JwtBearerEvents: Trigger AuthenticationFailed
            alt AuthenticationFailed handled
                JwtWebSocketAuthenticationService-->>GraphQLServer: Return principal (early exit)
            end
        end
    else EnableJwtEvents = false
        JwtWebSocketAuthenticationService-->>GraphQLServer: Standard JWT validation
    end
    GraphQLServer-->>Client: WebSocket authenticated or rejected
Loading

Possibly related PRs


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🔭 Outside diff range comments (2)
src/GraphQL.AspNetCore3.JwtBearer/JwtWebSocketAuthenticationService.cs (2)

78-110: ⚠️ Potential issue

Possible null token after MessageReceived event

If the OnMessageReceived callback sets context.Token = null to suppress
authentication, token becomes null, yet the subsequent validators call
validator.CanReadToken(token) which will throw ArgumentNullException.

Consider short-circuiting when the event nullifies the token:

token = messageResult.Token;
+if (string.IsNullOrEmpty(token))
+    continue; // event intentionally suppressed authentication for this scheme
🧰 Tools
🪛 GitHub Actions: Check formatting

[error] 94-94: WHITESPACE: Fix whitespace formatting. Replace 21 characters with '\s'.


[error] 97-97: WHITESPACE: Fix whitespace formatting. Replace 25 characters with '\s'.


[error] 99-99: WHITESPACE: Fix whitespace formatting. Replace 29 characters with '\s'.


[error] 106-106: WHITESPACE: Fix whitespace formatting. Replace 49 characters with '\n '.


1-333: ⚠️ Potential issue

Formatting violations break the CI pipeline

dotnet format (or your repo’s formatting tool) reports >30 whitespace errors
(lines 94, 97, 99 … 310). Please run the formatter to unblock CI.

🧰 Tools
🪛 GitHub Actions: Check formatting

[error] 94-94: WHITESPACE: Fix whitespace formatting. Replace 21 characters with '\s'.


[error] 97-97: WHITESPACE: Fix whitespace formatting. Replace 25 characters with '\s'.


[error] 99-99: WHITESPACE: Fix whitespace formatting. Replace 29 characters with '\s'.


[error] 106-106: WHITESPACE: Fix whitespace formatting. Replace 49 characters with '\n '.


[error] 161-161: WHITESPACE: Fix whitespace formatting. Replace 73 characters with '\n '.


[error] 162-162: WHITESPACE: Fix whitespace formatting. Replace 37 characters with '\n '.


[error] 163-163: WHITESPACE: Fix whitespace formatting. Replace 37 characters with '\s'.


[error] 166-166: WHITESPACE: Fix whitespace formatting. Replace 41 characters with '\s'.


[error] 170-170: WHITESPACE: Fix whitespace formatting. Replace 81 characters with '\n '.


[error] 173-173: WHITESPACE: Fix whitespace formatting. Replace 73 characters with '\n '.


[error] 174-174: WHITESPACE: Fix whitespace formatting. Replace 37 characters with '\n '.


[error] 179-179: WHITESPACE: Fix whitespace formatting. Replace 37 characters with '\s'.


[error] 182-182: WHITESPACE: Fix whitespace formatting. Replace 41 characters with '\s'.


[error] 188-188: WHITESPACE: Fix whitespace formatting. Replace 73 characters with '\n '.


[error] 189-189: WHITESPACE: Fix whitespace formatting. Replace 37 characters with '\n '.


[error] 190-190: WHITESPACE: Fix whitespace formatting. Replace 33 characters with '\n '.


[error] 232-232: WHITESPACE: Fix whitespace formatting. Replace 21 characters with '\n '.


[error] 233-233: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 238-238: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 242-242: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 244-244: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 245-245: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\n '.


[error] 246-246: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 260-260: WHITESPACE: Fix whitespace formatting. Replace 21 characters with '\n '.


[error] 261-261: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 267-267: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 271-271: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 273-273: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 274-274: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\n '.


[error] 275-275: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 279-279: WHITESPACE: Fix whitespace formatting. Replace 13 characters with '\s'.


[error] 292-292: WHITESPACE: Fix whitespace formatting. Replace 21 characters with '\n '.


[error] 293-293: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 298-298: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 302-302: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 304-304: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 305-305: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\n '.


[error] 306-306: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 310-310: WHITESPACE: Fix whitespace formatting. Replace 13 characters with '\s'.

🧹 Nitpick comments (3)
src/GraphQL.AspNetCore3.JwtBearer/AspNetCore3JwtBearerExtensions.cs (1)

18-21: Nit: avoid the empty lambda allocation

The parameterless overload allocates a new delegate (options => { }) on every
call. A cached static delegate removes that tiny, but unnecessary, allocation.

-private static readonly Action<JwtBearerAuthenticationOptions> _noOp = _ => { };
-
-=> builder.AddJwtBearerAuthentication(_noOp);
+private static readonly Action<JwtBearerAuthenticationOptions> _noOp = _ => { };
+
+=> builder.AddJwtBearerAuthentication(_noOp);
src/GraphQL.AspNetCore3.JwtBearer/JwtWebSocketAuthenticationService.cs (2)

120-131: Duplicate event-handling logic

TokenValidated logic is repeated for both NET8 and legacy branches. Extract
the common fragment into a local function to improve readability and reduce the
risk of divergent behaviour in the future.


319-325: EventResult.Token should be nullable

Token is empty-string initialised, but callers interpret empty as a valid
value and overwrite token with it. Make it nullable (string?) to
differentiate not set from intentionally cleared.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2ea3660 and 9f1e989.

📒 Files selected for processing (7)
  • src/GraphQL.AspNetCore3.JwtBearer/AspNetCore3JwtBearerExtensions.cs (1 hunks)
  • src/GraphQL.AspNetCore3.JwtBearer/JwtBearerAuthenticationOptions.cs (1 hunks)
  • src/GraphQL.AspNetCore3.JwtBearer/JwtWebSocketAuthenticationService.cs (6 hunks)
  • src/Tests.ApiApprovals/ApiApprovalTests.cs (2 hunks)
  • src/Tests.ApiApprovals/GraphQL.AspNetCore3.JwtBearer.approved.txt (1 hunks)
  • src/Tests.ApiApprovals/Tests.ApiTests.csproj (1 hunks)
  • src/Tests/JwtBearer/AspNetCore3JwtBearerExtensionsTests.cs (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/Tests/JwtBearer/AspNetCore3JwtBearerExtensionsTests.cs (1)
src/GraphQL.AspNetCore3.JwtBearer/JwtBearerAuthenticationOptions.cs (1)
  • JwtBearerAuthenticationOptions (8-17)
src/GraphQL.AspNetCore3.JwtBearer/AspNetCore3JwtBearerExtensions.cs (1)
src/GraphQL.AspNetCore3.JwtBearer/JwtBearerAuthenticationOptions.cs (1)
  • JwtBearerAuthenticationOptions (8-17)
🪛 GitHub Actions: Check formatting
src/Tests/JwtBearer/AspNetCore3JwtBearerExtensionsTests.cs

[error] 28-28: WHITESPACE: Fix whitespace formatting. Replace 21 characters with '\n '.


[error] 29-29: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\n '.

src/GraphQL.AspNetCore3.JwtBearer/JwtWebSocketAuthenticationService.cs

[error] 94-94: WHITESPACE: Fix whitespace formatting. Replace 21 characters with '\s'.


[error] 97-97: WHITESPACE: Fix whitespace formatting. Replace 25 characters with '\s'.


[error] 99-99: WHITESPACE: Fix whitespace formatting. Replace 29 characters with '\s'.


[error] 106-106: WHITESPACE: Fix whitespace formatting. Replace 49 characters with '\n '.


[error] 161-161: WHITESPACE: Fix whitespace formatting. Replace 73 characters with '\n '.


[error] 162-162: WHITESPACE: Fix whitespace formatting. Replace 37 characters with '\n '.


[error] 163-163: WHITESPACE: Fix whitespace formatting. Replace 37 characters with '\s'.


[error] 166-166: WHITESPACE: Fix whitespace formatting. Replace 41 characters with '\s'.


[error] 170-170: WHITESPACE: Fix whitespace formatting. Replace 81 characters with '\n '.


[error] 173-173: WHITESPACE: Fix whitespace formatting. Replace 73 characters with '\n '.


[error] 174-174: WHITESPACE: Fix whitespace formatting. Replace 37 characters with '\n '.


[error] 179-179: WHITESPACE: Fix whitespace formatting. Replace 37 characters with '\s'.


[error] 182-182: WHITESPACE: Fix whitespace formatting. Replace 41 characters with '\s'.


[error] 188-188: WHITESPACE: Fix whitespace formatting. Replace 73 characters with '\n '.


[error] 189-189: WHITESPACE: Fix whitespace formatting. Replace 37 characters with '\n '.


[error] 190-190: WHITESPACE: Fix whitespace formatting. Replace 33 characters with '\n '.


[error] 232-232: WHITESPACE: Fix whitespace formatting. Replace 21 characters with '\n '.


[error] 233-233: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 238-238: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 242-242: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 244-244: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 245-245: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\n '.


[error] 246-246: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 260-260: WHITESPACE: Fix whitespace formatting. Replace 21 characters with '\n '.


[error] 261-261: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 267-267: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 271-271: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 273-273: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 274-274: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\n '.


[error] 275-275: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 279-279: WHITESPACE: Fix whitespace formatting. Replace 13 characters with '\s'.


[error] 292-292: WHITESPACE: Fix whitespace formatting. Replace 21 characters with '\n '.


[error] 293-293: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 298-298: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 302-302: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 304-304: WHITESPACE: Fix whitespace formatting. Replace 17 characters with '\n '.


[error] 305-305: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\n '.


[error] 306-306: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\s'.


[error] 310-310: WHITESPACE: Fix whitespace formatting. Replace 13 characters with '\s'.

🪛 LanguageTool
src/Tests.ApiApprovals/GraphQL.AspNetCore3.JwtBearer.approved.txt

[duplication] ~11-~11: Possible typo: you repeated a word.
Context: ...ateAsync(GraphQL.AspNetCore3.WebSockets.AuthenticationRequest authenticationRequest) { } public sealed class AuthPa...

(ENGLISH_WORD_REPEAT_RULE)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test (windows-latest)
  • GitHub Check: test (ubuntu-latest)
🔇 Additional comments (6)
src/Tests.ApiApprovals/Tests.ApiTests.csproj (1)

19-19: Project reference correctly added

The added reference to the JwtBearer project is necessary for API approval tests to properly validate the public API surface of the new JWT functionality.

src/Tests.ApiApprovals/ApiApprovalTests.cs (2)

2-2: Namespace import correctly added

Adding the JwtBearer namespace import is necessary to reference the new service type in the tests.


16-16: API approval test coverage properly extended

Including JwtWebSocketAuthenticationService in the API approval tests ensures that its public API surface is verified and tracked for any future changes.

src/GraphQL.AspNetCore3.JwtBearer/JwtBearerAuthenticationOptions.cs (1)

1-17: Well-designed options class for JWT Bearer authentication

The new JwtBearerAuthenticationOptions class is well-structured and follows the standard .NET options pattern. The EnableJwtEvents property is clearly named and well-documented, making it easy for users to understand how to configure JWT event handling for WebSocket connections.

src/GraphQL.AspNetCore3.JwtBearer/JwtWebSocketAuthenticationService.cs (1)

137-146: AuthenticationFailed event: make success path explicit

If the AuthenticationFailed event sets context.NoResult() the current code
treats it as not handled (Handled = true, Success = false) and silently
continues to the next scheme – good. However, when the event sets
context.Success() but does not assign context.Principal, a subsequent
NRE will be thrown when you dereference failedResult.Principal!. Defensive
check recommended.

src/Tests.ApiApprovals/GraphQL.AspNetCore3.JwtBearer.approved.txt (1)

1-27: No review needed – generated approval file

This file is auto-generated by the public-API approval tests. Changes simply
reflect the new public surface and do not need manual review.

🧰 Tools
🪛 LanguageTool

[duplication] ~11-~11: Possible typo: you repeated a word.
Context: ...ateAsync(GraphQL.AspNetCore3.WebSockets.AuthenticationRequest authenticationRequest) { } public sealed class AuthPa...

(ENGLISH_WORD_REPEAT_RULE)

Comment thread src/Tests/JwtBearer/AspNetCore3JwtBearerExtensionsTests.cs Outdated
Comment thread src/GraphQL.AspNetCore3.JwtBearer/AspNetCore3JwtBearerExtensions.cs
Comment thread src/GraphQL.AspNetCore3.JwtBearer/AspNetCore3JwtBearerExtensions.cs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3ecb39 and 033f8df.

📒 Files selected for processing (3)
  • .github/workflows/test.yml (0 hunks)
  • src/Tests/JwtBearer/JwtWebSocketAuthenticationServiceTests.cs (1 hunks)
  • src/Tests/Tests.csproj (1 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/test.yml
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test (windows-latest)
  • GitHub Check: test (ubuntu-latest)
🔇 Additional comments (2)
src/Tests/JwtBearer/JwtWebSocketAuthenticationServiceTests.cs (1)

256-256: LGTM: This correctly enables JWT event handling for tests

The addition of the true parameter to AddJwtBearerAuthentication() properly enables the new JWT event handling capability for these tests, aligning with the PR objective of adding JWT Bearer event trigger support.

src/Tests/Tests.csproj (1)

7-7: Update Windows test configurations to match supported TFMs
The Windows-specific <TargetFrameworks> group now includes net48;netcoreapp2.1;net6.0;net8.0. Ensure that all conditional <PackageReference> entries (e.g., JwtBearer, Mvc.Testing) correctly cover these frameworks and that version constraints remain accurate.

Comment thread src/Tests/Tests.csproj Outdated
@github-actions

github-actions Bot commented May 7, 2025

Copy link
Copy Markdown

Coverage Report

Totals Coverage
Statements: 93.36% ( 2053 / 2199 )
Methods: 80.88% ( 313 / 387 )

@Shane32 Shane32 changed the title Add capability to trigger JwtBearer events Add capability to raise JwtBearer events May 7, 2025
@Shane32 Shane32 merged commit 5184bfd into master May 7, 2025
@Shane32 Shane32 deleted the add_events branch May 7, 2025 20:49
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 14892854898

Details

  • 53 of 95 (55.79%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.4%) to 91.331%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/GraphQL.AspNetCore3.JwtBearer/AspNetCore3JwtBearerExtensions.cs 2 3 66.67%
src/GraphQL.AspNetCore3.JwtBearer/JwtWebSocketAuthenticationService.cs 50 91 54.95%
Totals Coverage Status
Change from base Build 12109341911: -1.4%
Covered Lines: 2053
Relevant Lines: 2199

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants